1. Field of the Invention
The present invention relates to computer systems that support virtual machines. More specifically, the present invention relates to a method and an apparatus that facilitates intermediate linking of binary files in a virtual machine.
2. Related Art
The Java 2 Platform, Micro Edition (J2ME™), has become very popular in the wireless device space. Motorola, Nokia, NTT DoCoMo, RIM, Siemens, and many other key players in the wireless device industry have recently started shipping J2ME-enabled devices in very high volume. It has been estimated that over 200 million J2ME-enabled mobile phones were shipped in 2003 alone.
However, in spite of the success of the J2ME platform, significant challenges for JAVA technology remain in the memory-constrained device space. One major limiting factor in J2ME application development is application size. With the deployment of more significant J2ME applications in mobile devices, J2ME application downloads will consume an increasingly large amount of wireless network bandwidth. Moreover, the runtime dynamic memory costs and application startup costs associated with anything but small J2ME applications are still excessive for most mass-market consumer devices, as well as for serious mobile systems software development in the JAVA programming language.
Cell phone manufacturers are under extreme price and power constraints. Providing more memory in a cell phone costs more money and uses more power. Reducing the amount of memory necessary to run JAVA applications would result in substantial savings for cell phone manufacturers.
However, reducing memory requirements for JAVA applications is not an easy task. Existing devices operate by loading a number of JAVA class files into memory, converting the classes into an internal format that the JAVA Virtual Machine (JVM) can execute, and then executing them. This process is not only time consuming, but consumes a great deal of memory as well.
Once the class files are converted to an internal format for the JVM, this internal format “image” can be stored. In this way, subsequent executions of the class files do not have to load the class files and convert them into the internal format again. The system can simply read in the already converted “image”. However, this presents new problems.
There is no guarantee that the JVM will be loaded at the same virtual memory address as it was when the classes were converted into the binary “image”. Moreover, the memory layout of the heap may not be exactly the same as when the binary “image” was created. Hence, the binary “image” may have pointers to locations in the JVM and the heap that are no longer valid.
Hence, what is needed is a method and an apparatus for resolving these references in a virtual machine.